package vista;

import modelo.Ingrediente;
import modelo.IngredienteDao;

import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class frmcantidaddisponibleporingrediente extends javax.swing.JFrame {
	private JScrollPane scdisponibilidadingrediente;
	private JLabel lblcantidaddisponible;
	private JSeparator sp;
	private JButton btnsalir;
	private JTable tblIngredientes;
	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frmcantidaddisponibleporingrediente inst = new frmcantidaddisponibleporingrediente();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public frmcantidaddisponibleporingrediente() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.setTitle("Cantidad Disponible por Ingrediente");
			{
				scdisponibilidadingrediente = new JScrollPane();
				getContentPane().add(scdisponibilidadingrediente);
				scdisponibilidadingrediente.setBounds(25, 52, 326, 156);
				{
					tblIngredientes = new JTable();
					scdisponibilidadingrediente.setViewportView(tblIngredientes );
				}
			}
			{
				btnsalir = new JButton();
				getContentPane().add(btnsalir);
				btnsalir.setText("Salir");
				btnsalir.setBounds(287, 228, 64, 23);
			}
			{
				sp = new JSeparator();
				getContentPane().add(sp);
				sp.setBounds(0, 214, 384, 10);
			}
			{
				lblcantidaddisponible = new JLabel();
				getContentPane().add(lblcantidaddisponible);
				lblcantidaddisponible.setText("Cantidad Disponible por Ingrediente");
				lblcantidaddisponible.setBounds(81, 24, 235, 16);
				lblcantidaddisponible.setFont(new java.awt.Font("Segoe UI",1,12));
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
	public void setResultados(AbstractTableModel abstractTableModel) {
		tblIngredientes.setModel(abstractTableModel);
	}
	public void addListener(ActionListener actionListener) {
		btnsalir.addActionListener(actionListener);
		}
}
